Cryptography Using Transposition Cipher
Satish Kumar Garg
Govt. P G College Ambala Cantt. - 133001
*Corresponding Author E-mail: sat.phy@gmail.com
Abstract:
In the present work the author has suggested a unique cryptographic method where bit level manipulation is done using transposition cipher. In this method, first by using Extended ASCII Code, input string of characters is converted into digital form then transposition cipher is applied on this string and finally by reverse of the Extended ASCII Code on this transposed string, bits are converted into characters. The proposed method can be applied to encrypt any data consisting of 10 or more characters. The results obtained after application of proposed algorithm are excellent and difficult to decrypt.
KEYWORDS: Encryption, Decryption, Transposition Cipher
1. INTRODUCTION:
In today’s global scenario, internet is used for communication of information[1, 2] from one place to another place irrespective of its distance. So it has become a real challenge for the sender to send confidential information from one place to another place. The security and originality of information [1] has now become very challenging because there is always a possibility that any unauthorized person may intercept our confidential information and may alter this information or may make it meaningless. The confidential information may be bank statements, bank transaction, military information, confidential data of companies etc. So, it is not safe to send confidential information from one place to another place through internet and hence the information should be protected from any unwanted intruder otherwise any massive disaster may happen all-on-a-sudden. In order to secure the system one should consider the security primary attributes such as confidentiality, integrity, availability etc. and secondary attributes such as authenticity, non-repudiation, accountability etc. There are a large number of techniques to achieve these security goals, one of these is Cryptography. Cryptography [3, 4] is the study of mathematical techniques related to aspects of information security such as confidentiality, data integrity, entity authentication, and data origin authentication. Cryptography is not the only means of providing information security, but rather one set of techniques. The cryptographic algorithm can be classified into two categories: (i) Symmetric Key Cryptography where one key is used for both encryption and decryption purpose. (ii) Public Key Cryptography where two different keys are used, one for encryption and the other for decryption purpose. Due to massive computation the public key crypto system may not be suitable in security of data in sensor networks [5]. The author has developed an algorithm named as algorithm SKG 1.0 which is successful for encrypting any text/string consisting of 30 or more characters [6].
In the present work the author suggested a unique cryptographic method where bit level manipulation is done using transposition cipher. In this method, first by using Extended ASCII Code, input string of characters is converted into digital form then transposition cipher is applied on this string and finally by using reverse of the Extended ASCII Code on this transposed string, bits are converted into characters. The proposed method can be applied to encrypt any data consisting of 10 or more characters. The results obtained after application of proposed algorithm are excellent and difficult to decrypt.
2. THEORY :
This algorithm is based on the concept that each character is represented by a unique 8-bit code in Extended ASCII Code system and if one or more bits are changed in a 8-bit code[6], then corresponding character is entirely changed. When any text of 10 characters is converted into binary form we get 80 bits which contains about 50% of 0’s and 1’s each. Therefore, total number of possible combinations is about 80!/(40!)2= 1075×1020. The Super Computer available is Teraflop which is capable of doing 1012 floating point calculations per second, so a teraflop super computer shall take about 3409 Years to find all possible combinations. This time is sufficiently large for any message to reside on any network [5].
3. PROPOSED ENCRYPTION ALGORITHM
1. Read the input string of characters and Check the number of characters, N
2. If N<10, then write Program is Not Applicable
3. By using Extended ASCII Code, input string of characters is converted into digital form
4. If (8N+1)/N1 = 0, Transpose Integral Multiples of LMB with corresponding RMB upto middle of the string otherwise proceed upto 8N bits
5. By using reverse of the Extended ASCII Code, the string of bits is converted into character form
6. Output is Encrypted String i.e., Cipher Text
4. SCHEMATIC DIAGRAM FOR PROPOSED ALGORITHM
5. PSEUDO CODE FOR PROPOSED ENCRYPTION ALGORITHM
// Read the input string of characters and Check the number of characters N, if N is less than 10, give error message
Step 1: Start
Step 2: Read input N
Step 3: If (N.length()< 10)
Print error message ‘Program is Not Applicable’;
//Convert the N characters into binary form using Extended ASCII Code (8-bit)
Step 4: initialize character array str[]//copying each character of string to character array str[]
Step 5: for(i=0; i<N.length(); i++)
{
If(i==N.length() – 1)
Str[i] = N.substring(i);
else
Str[i] = N.substring(i, i+1);
}
Step 6: initialize byte array bytes[] //copy each character of character array converted to
byte char
Step 7: for(i=0; i<str.length; i++)
{
bytes[i]= (byte) Str[i];
}
Step 8: for each byte in array, convert each byte to binary bits and create string of those
binary bits
// Transpose the integral multiples of leftmost N1 bits with corresponding rightmost N1 bits
Step 9: initialize l = length of binary string // length of binary string is 8N, this will be
used at number of places in program
Step 10: initialize integer j (to store length to be traversed [loop through])
Step 11: Read value of N1
Step 12: integer r = remainder of (8N+1)modulusN1
Step 13: if (r==0)
j = l/2;
else
j = l;
Step 14: for(i=1;N1*i<=j;i++)
{
ch = charAt(N1*i-1);
Replace/ set charAt((N1*i)–1)th position with charAt((l+1)-(N1*i))th position;
Replace/ set charAt((l+1)-(N1*i))th position with char stored in
variable ‘ch’;
}
// Convert 8N bits so obtained into the characters of N characters using Reverse ASCII Code (8-bit)
Step 15: String s2 = ‘’;
Step 16: String s=binary; // to store the binary string
Step 17: char nextChar; // declare the variable to store next significant character in string
Step 18: s2 = s2 + nextChar;
}
Step 19: return s2 to output file // return the final string
The decryption algorithm is just the reverse of the encryption algorithm
6. IMPLEMENTATION OF PROPOSED ALGORITHM :
We have implemented the proposed algorithm on Java platform for different values of N1 = 1 to 8N/6. For example for the plain text given below, cipher text is shown in Table 1 for different values of the key, N1.
“Ambala Cantt is situated on the North-Eastern edge of Haryana. It is known as City of Scientific Instruments on International level. It is gate way to Chandigarh, Panjab, Himachal Pradesh and Jammu and Kashmir”
Table 1 : Cipher Text for different values of keys for the same Plain Text
|
S. No. |
Keys N1 |
Cipher Text |
|
1. |
1 |
N?╢╬?╥ d«╢╢?R&v? ╬ª&?N6?╞?╢? 4F?Vv? 4N?µ?&v?┬ ÷.??εª.?µ╬?.?t6ªnª66?v÷?.?vNª.v? v÷╬.vª╢«N.╬v? ╞?f?.vª?╞╩ f÷?.?┬╬?vε÷v╓╬?.?t?v??N? f÷ªµ&ªvNª.╬?ó┤.N÷rª. v÷&ª.?«.?╬ ╬?..v?┬?6?F╢? |
|
2. |
3 |
G╢&Wε?dL«4╢óR"d╞$╞ª$?n 6WΓ ▓L4D╟rt╟*46L╟µov^Γ *╫ªlMª,╧Γ╧╢g╢u2$gó4M2v≥gódNª,v▓6╥╟.vτ╢,N.^6╢??f╓.vε▓T╦$f≈$ n╢REεR|╢rVεD.Ep6ª ?EfdMªdfó6J$nΩΓ┤njds $W. v≥fª>╬¬,▐ε╬▓o.d?Γ╟2O▓ |
|
3. |
4. |
H⌠≥p∞α░B`f∞⌠░αr bpΣdp∞Σdánn tαtá╞÷≥t`4DαrtΣjf0tlµΣ░fváPαb≡hf°ª¿@Σ(αΓ Ω÷fn÷ práJαt`0µv░╥jαtnΣhv≡b0╨fΩlrΣ⌠∞nlΩ0÷fá╨f⌠lrµ≡ΣΦff≡d╕l⌠µd∞ª P∞░p≥ ε≡dl░fpα0Σ■(┬p`f⌠`µαbα$0HαnΩαΓ┤0Hh⌠pbαpl P≥`dΣjα¿h÷∞ ╩≡dll0ªáBαrαd≡ |
|
4. |
5 |
K?÷DL#rGdF>6┤╠R #}╘T#fσdo.$t@'b╬εR6(=D@svσRF 7d╞d"/v?@c ²dF+.ñLt*+τJ&-g╩a3ñf`6)4╬fbg╠dn&mf@! r▌NZ>rσ∞ln&τ$F$ b▌nT/rε─Tk-nΣD*.⌡╥Dn.$l|b{≈N#$e?Va+4╘NjxDff)τΣr",4T`.jσΓ$" m∞`!*ulRredd;*ñdFn ╬─D/'4?#w╠D#" |
|
5. |
10 |
C-≥Elc`Cefv4░Mr 3yTtctσd o. t`g`╬orv(=E`stσRf %dGd"/v@c2∙e fc.áMt")πjn/gJ a3ág`v90Of"cMdn4if`a`┘Nzvrσmln4π$fl`┘nt grεEtk/ned",⌡Rdn. m|"i≤nc4eva90Tn"xEff)τerj,0T`njßb$"im`a(ql Rradds(áeff ╩Edo50I!sLdk2 |
|
6. |
15 |
Cofela0CaN44áΦr smtuadedo. thg"North=EAstσrn gdge ovHa2∙`nc.$Mt(icK./wε as$Gati0Of`cΦdnvmfac0YNS4r⌡∞dnvw$gf YnT%rεαtkmned(luVEl. Ht"kw$oadeWa9 ⌠n"Chefdigar(, P`njeb$ Hima#(al Rrede{h aNd ╩αlow$& CasHM)2 |
7. RESULTS AND DISCUSSION :
We have implemented the proposed algorithm on Java platform for different values of N1(= 1 to 8N/6). From Table 1, it is clear that if we change value of the key N1 then output of the proposed algorithm i.e., Cipher Text is entirely different.
8. CONCLUSION :
The proposed algorithm was tested on Java platform for different values of N (=30 to 1000) each for different values of N1= 1 to 8N/6. In all cases the result came as per our expectations. It has been estimated that to crack the code we will require more time than the data will reside on the medium to travel. So, it can be said that the proposed scheme will produce an efficient secured algorithm for data transfer in both wired and wireless networks.
9. REFERENCES
1. S. K. Garg, Review of Secured Routing for Wireless Ad hoc Network, International Journal of Computing and Business Research, 2 (1), 2011.
2. S. K. Garg, Wireless Network Security Threats, International Journal of Information Dissemination and Technology, 1 (1), 2011.
3. T. Karygiannis and L. Owens, Wireless Network Security, NIST Special Publication, 2002.
4. William Stallings, Cryptography and Network Security: Principles and Practice, Prentice Hall, 5th Edition, 2011.
5. R. H. Karpinski, Reply to Hoffman and Shaw, Datamation, 16(10) p. 11 (Oct. 1970).
6. S. K. Garg, Information Security By Interchanging Characters: Algorithm SKG 1.0, International Journal of Information Technology and Knowledge Management, 6 (2), 2013.
|
Received on 22.11.2016 Modified on 26.11.2016 Accepted on 28.11.2016 ©A&V Publications All right reserved DOI:
10.5958/2349-2988.2017.00008.0 Research J. Science and Tech. 2017; 9(1):48-50.
|
|